package cn.sciento.transfer.infra.repository.impl;

import cn.sciento.core.domain.Page;
import io.choerodon.mybatis.pagehelper.PageHelper;
import io.choerodon.mybatis.pagehelper.domain.PageRequest;
import java.util.List;
import cn.sciento.mybatis.base.impl.BaseRepositoryImpl;
import cn.sciento.transfer.domain.entity.ConsTenantConfig;
import cn.sciento.transfer.domain.repository.ConsTenantConfigRepository;
import cn.sciento.transfer.infra.mapper.ConsTenantConfigMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class ConsTenantConfigRepositoryImpl extends BaseRepositoryImpl<ConsTenantConfig> implements ConsTenantConfigRepository {
  @Autowired
  private ConsTenantConfigMapper consTenantConfigMapper;
  
  public Page<ConsTenantConfig> pageAndSortConsTenantConfig(PageRequest pageRequest, ConsTenantConfig consTenantConfig) {
    return PageHelper.doPageAndSort(pageRequest, () -> this.consTenantConfigMapper.listConsTenantConfig(consTenantConfig));
  }
  
  public List<ConsTenantConfig> selectConsTenantByIds(List<Long> idList) {
    return this.consTenantConfigMapper.selectConsTenantByIds(idList);
  }
}
